package Text_32;

public class Number {

	public static void main(String[] args) {
		//水仙花数
        int count = 0;
        for (int i = 100; i <=999 ; i++) {
            int ge = i%10;
            int shi = (i/10)%10;
            int bai = ((i/10)/10)%10;
            double sum = Math.pow(ge,3)+Math.pow(shi,3)+Math.pow(bai,3);
            if(sum==i){
                count++;
                System.out.println(i);
            }
        }
        System.out.println(count);
        System.out.println("==========================");
        //四叶玫瑰数
        int count1 = 0;
        for (int i = 1000; i <=9999 ; i++) {
            int ge = i%10;
            int shi = (i/10)%10;
            int bai = ((i/10)/10)%10;
            int qi = (((i/10)/10)/10)%10;
            double sum = Math.pow(ge,4)+Math.pow(shi,4)+Math.pow(bai,4)+Math.pow(qi,4);
            if(sum==i){
                count1++;
                System.out.println(i);
            }
        }
        System.out.println(count1);


	}

}
